package com.saxon.springcloud.service;

import com.saxon.springcloud.dao.DeptDao;
import com.saxon.springcloud.pojo.Dept;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceimpl implements DeptService {

    DeptDao deptDao;

    @Autowired
    public void setDeptDao (DeptDao deptDao) {
        this.deptDao = deptDao;
    }

    @Override
    public int insertDept (Dept dept) {
        return deptDao.insertDept (dept);
    }

    @Override
    public Dept queryDeptById (long id) {
        return deptDao.queryDeptById (id);
    }

    @Override
    public List<Dept> queryAllDept () {
        return deptDao.queryAllDept ();
    }
}
